package com.migu.rbac.message;

import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Description TODO :
 * @Author: zj
 * @Date: 14:26 2019/6/4
 * @Version 1.0
 **/
@Component
public class RbacSendMsgFallback implements FallbackFactory<RbacSendMsgService> {
    private static final Logger log = LoggerFactory.getLogger(RbacSendMsgFallback.class);


    @Override
    public RbacSendMsgService create(Throwable throwable) {
        if (throwable != null) {
            log.error(throwable + "RbacSendMsgService");
        }
        return map -> "error";
    }
}
